<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
		<title>博烨教育</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<link rel="stylesheet" href="layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="login.css">
		<script type="text/javascript" src="js/jquery-2.1.1.js"></script>
		<script type="text/javascript" src="js/public.js"></script>
		<link rel="stylesheet" type="text/css" href="page/background/background.css">
        

</head>

<body>
<canvas id="canvas"></canvas>

<div id="text">
	<div id="clic" nowrap></div>
</div>
<form class="login">
<center>
		<h1 style="margin-top: 30px;">博烨教育管理后台</h1>
</center>
  <div class="form-group">
    <input type="text" class="user" name="user" placeholder="请输入您的用户名" id="username">
    <input type="password" class="pwd" name="pwd" placeholder="请输入您的密码" id="password">
  </div>
  <span class="links">
    <a href="" >开通账号需联系管理员</a>
    <a href="" >默认无注册入口</a>
  </span>
  <br/>
  <input type="button" class="btn" value="登录" onclick="login()">
</form>
<script type="text/javascript" src="page/background/background.js"></script>
<script>
	$(document).keydown(function(e) {
	          if (e.keyCode == 13) {
	                 login();
	          }
   			})
   	var lpo=0;
	function login(){
		console.log(lpo);
		if(lpo==0){
			return;
		}
				  var username = $('#username').val();
		    	var password = $('#password').val();
		    	$.ajax({
                        url:bulicUrl+'dologin.php',
                        type:'POST',
                        dataType:'json',
                        data:{username:username,password:password},
                        success:function(result){
                            if(result=='nameerror'){
                                alert('用户名不存在');
                            }else if(result=="passerror"){
                                alert("密码错误");
                            }else{
                            	window.sessionStorage.setItem('userId',result[0]);//保存当前登录用户id用来判断是否是管理员
                            	window.sessionStorage.setItem('userName',result[3]);
                            	window.sessionStorage.setItem('scale',Number(result[7]));
                            	window.sessionStorage.setItem('condition',0);
                                window.location.href = 'index1.html';//登录成功跳转
                            }
                        },error: function (xhr, textStatus, errorThrown) {
						            /*错误信息处理*/
						　　　　　　　　alert("登录未成功");
						　　　　　　　　//alert("状态码："+xhr.status);
						 　　　　　　　  //alert("状态:"+xhr.readyState)；//当前状态,0-未初始化，1-正在载入，2-已经载入，3-数据进行交互，4-完成。
						　　　　　　　　//alert("错误信息:"+xhr.statusText );
						　　　　　　　　//alert("返回响应信息："+xhr.responseText );//这里是详细的信息
						　　　　　　　　//alert("请求状态："+textStatus);
						　　　　　　　　//alert(errorThrown);
						　　　　　　　　//alert("请求失败");
						　　　　}
                    });
			}
	//下面都是动态效果
	$(document).ready(function(){

   $('form').find('.btn').on('click',function(){
   	  lpo+=1;
      $(this).parent().css({
        'height' : '350px',
        'transform' : 'translateY(50px)'
      });
        $(this).siblings('.form-group').css({
          'top':'10%'
        });
        $(this).siblings('.links').css({
          'top':'65%'
        });
      });
    
  
  
  /*-------- focus in ---------*/
  $('.pwd').on('focusin',function(){
    $(this).siblings('.user').css({
      'z-index'   :'1',
      'background':'rgba(0,0,0,.038)',
    });
     $(this).css({
      'z-index' : '2',
      'background' : '#fff',
      });
  });
  
  
   $('.user').on('focusin',function(){
    $(this).siblings('.pwd').css({
      'z-index'   :'1',
      'background':'rgba(0,0,0,.038)'
    });
    $(this).css({
      'z-index' : '2',
      'background' : '#fff'
     });
  });
  
  /*----------- focus out ---------*/
  $('.pwd').on('focusout',function(){
    $(this).siblings('.user').css({
      'z-index'   :'1',
      'background':'rgba(0,0,0,.038)'
    });
    $(this).css({
      'z-index' : '2',
      'background' : '#fff'
    });
  });
  
  
   $('.user').on('focusout',function(){
    $(this).siblings('.pwd').css({
      'z-index'   :'1',
      'background':'rgba(0,0,0,.038)'
    });
    $(this).css({
      'z-index' : '2',
      'background' : '#fff'
     });
  });
})
</script>
<style>
	/*---------- the prefixer -------------*/
body {
  background-color: #1685a9;
  -webkit-transition: 0.3s;
  -moz-transition: 0.3s;
  -ms-transition: 0.3s;
  -o-transition: 0.3s;
  transition: 0.3s;
}

* {
  font-family: 'Microsoft YaHei';
}

input {
  color: #000!important;
  font-size: 16px;
}

.login {
  position: relative;
  background: #fbfbfb;
  display: block;
  width: 500px;
  height: 70px;
  margin: 10% auto;
  overflow: hidden;
  -webkit-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -moz-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -ms-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -o-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  -ms-border-radius: 4px;
  -o-border-radius: 4px;
  border-radius: 4px;
  -webkit-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.2);
  -ms-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.2);
  -o-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.2);
  box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.2);
  -webkit-transform: translateY(-50px);
  -moz-transform: translateY(-50px);
  -ms-transform: translateY(-50px);
  -o-transform: translateY(-50px);
  transform: translateY(-50px);
}

.form-group {
  position: relative;
  top: 90%;
  left: 8%;
  -webkit-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -moz-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -ms-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -o-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -webkit-transition-delay: 1s;
  transition-delay: 1s;
}

.user,
.pwd {
  position: absolute;
  display: block;
  width: 80%;
  height: 60px;
  background: #fff;
  font-size: 10pt;
  padding-left: 20px;
  color: rgba(0, 0, 0, 0.038);
  -webkit-box-shadow: 1px 1px 20px rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 1px 1px 20px rgba(0, 0, 0, 0.2);
  -ms-box-shadow: 1px 1px 20px rgba(0, 0, 0, 0.2);
  -o-box-shadow: 1px 1px 20px rgba(0, 0, 0, 0.2);
  box-shadow: 1px 1px 20px rgba(0, 0, 0, 0.2);
  border: none;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  -ms-border-radius: 4px;
  -o-border-radius: 4px;
  border-radius: 4px;
  -webkit-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -moz-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -ms-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -o-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.user:focus, .user:active:focus,
.pwd:focus,
.pwd:active:focus {
  outline: none;
  padding-left: 30px;
}

.user {
  margin-bottom: 10%;
  z-index: 2;
  -webkit-transition: 0.5s;
  -moz-transition: 0.5s;
  -ms-transition: 0.5s;
  -o-transition: 0.5s;
  transition: 0.5s;
}

.pwd {
  margin-top: 10%;
  z-index: 1;
  background: rgba(0, 0, 0, 0.038);
  -webkit-transition: 0.5s;
  -moz-transition: 0.5s;
  -ms-transition: 0.5s;
  -o-transition: 0.5s;
  transition: 0.5s;
}

.links {
  position: absolute;
  top: 80%;
  left: 10%;
  margin: 0 auto;
  -webkit-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -moz-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -ms-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -o-transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transition: all 600ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
  -webkit-transition-delay: 1.2s;
  transition-delay: 1.2s;
}
.links a {
  text-decoration: none;
  display: block;
  float: left;
  width: 200px;
  height: 40px;
  text-align: left;
  color: #3d5059;
  font-size: 10pt;
}
.links a:last-child {
  text-align: right;
}

.btn {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 70px;
  border: none;
  background: #03a9f4;
  font-family: 'Microsoft YaHei','Lantinghei SC','Open Sans',Arial,'Hiragino Sans GB','STHeiti','WenQuanYi Micro Hei','SimSun',sans-serif;
  text-align: center;
  font-size: 18pt;
  color: #fff;
  z-index: 3;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  -ms-border-radius: 4px;
  -o-border-radius: 4px;
  border-radius: 4px;
  -webkit-transition: 0.3s;
  -moz-transition: 0.3s;
  -ms-transition: 0.3s;
  -o-transition: 0.3s;
  transition: 0.3s;
  color:#fff!important;
}
.btn:hover, .btn:focus, .btn:active:focus {
  background: #e91e63;
  cursor: pointer;
  outline: none;
  letter-spacing: 5px;
}

</style>
</body>
</html>